Move linear faulting address (%cr2) out of the page fault
authorkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Wed, 9 Nov 2005 16:23:46 +0000 (17:23 +0100)
committerkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Wed, 9 Nov 2005 16:23:46 +0000 (17:23 +0100)
stack frame and into vcpu_info_t (in shared_info_t). This
makes the guest #PF handler much more similar to native.

Signed-off-by: Keir Fraser <keir@xensource.com>
20 files changed:
linux-2.6-xen-sparse/arch/xen/i386/kernel/entry.S
linux-2.6-xen-sparse/arch/xen/i386/kernel/traps.c
linux-2.6-xen-sparse/arch/xen/i386/mm/fault.c
linux-2.6-xen-sparse/arch/xen/x86_64/kernel/entry.S
linux-2.6-xen-sparse/arch/xen/x86_64/kernel/traps.c
linux-2.6-xen-sparse/arch/xen/x86_64/kernel/xen_entry.S
linux-2.6-xen-sparse/arch/xen/x86_64/mm/fault.c
xen/arch/x86/setup.c
xen/arch/x86/traps.c
xen/arch/x86/x86_32/asm-offsets.c
xen/arch/x86/x86_32/entry.S
xen/arch/x86/x86_64/asm-offsets.c
xen/arch/x86/x86_64/entry.S
xen/include/asm-x86/domain.h
xen/include/asm-x86/processor.h
xen/include/public/arch-ia64.h
xen/include/public/arch-x86_32.h
xen/include/public/arch-x86_64.h
xen/include/public/dom0_ops.h
xen/include/public/xen.h

index d4ac275630d2e240858d1fe97bb281babf59dc42..ad38d736c7a891333652e9d183ed27e0c31ebf38 100644 (file)
@@ -81,7 +81,7 @@ VM_MASK               = 0x00020000
 #define evtchn_upcall_pending          /* 0 */
 #define evtchn_upcall_mask             1
 
-#define sizeof_vcpu_shift              3
+#define sizeof_vcpu_shift              4
 
 #ifdef CONFIG_SMP
 #define preempt_disable(reg)   incl TI_preempt_count(reg)
@@ -813,35 +813,9 @@ ENTRY(alignment_check)
        pushl $do_alignment_check
        jmp error_code
 
-# This handler is special, because it gets an extra value on its stack,
-# which is the linear faulting address.
-# fastcall register usage:  %eax = pt_regs, %edx = error code,
-#                          %ecx = fault address
 ENTRY(page_fault)
-       pushl %ds
-       pushl %eax
-       xorl %eax, %eax
-       pushl %ebp
-       pushl %edi
-       pushl %esi
-       pushl %edx
-       decl %eax                       /* eax = -1 */
-       pushl %ecx
-       pushl %ebx
-       cld
-       pushl %es
-#      UNWIND_ESPFIX_STACK
-       popl %edi
-       movl ES(%esp), %ecx             /* get the faulting address */
-       movl ORIG_EAX(%esp), %edx       /* get the error code */
-       movl %eax, ORIG_EAX(%esp)
-       movl %edi, ES(%esp)
-       movl $(__KERNEL_DS),%eax
-       movl %eax, %ds
-       movl %eax, %es
-       movl %esp,%eax                  /* pt_regs pointer */
-       call do_page_fault
-       jmp ret_from_exception
+       pushl $do_page_fault
+       jmp error_code
 
 #ifdef CONFIG_X86_MCE
 ENTRY(machine_check)
index 5a228097602932a29452bef0fb19b029f6341591..f1ef4e21e229c40b2104ecb236c696a0149dc1d5 100644 (file)
@@ -972,7 +972,7 @@ void __init trap_init_f00f_bug(void)
 
 
 /*
- * NB. All these are "trap gates" (i.e. events_mask isn't cleared) except
+ * NB. All these are "trap gates" (i.e. events_mask isn't set) except
  * for those that specify <dpl>|4 in the second field.
  */
 static trap_info_t trap_table[] = {
@@ -988,7 +988,7 @@ static trap_info_t trap_table[] = {
        { 11, 0, __KERNEL_CS, (unsigned long)segment_not_present        },
        { 12, 0, __KERNEL_CS, (unsigned long)stack_segment              },
        { 13, 0, __KERNEL_CS, (unsigned long)general_protection         },
-       { 14, 0, __KERNEL_CS, (unsigned long)page_fault                 },
+       { 14, 0|4, __KERNEL_CS, (unsigned long)page_fault               },
        { 15, 0, __KERNEL_CS, (unsigned long)fixup_4gb_segment          },
        { 16, 0, __KERNEL_CS, (unsigned long)coprocessor_error          },
        { 17, 0, __KERNEL_CS, (unsigned long)alignment_check            },
index 7ebbe25348d168f0dc4afe68fcc88580d4cc3671..7f8c79829c068773d78d0f5481637a9977db0845 100644 (file)
@@ -279,15 +279,18 @@ static void dump_fault_path(unsigned long address)
  *     bit 1 == 0 means read, 1 means write
  *     bit 2 == 0 means kernel, 1 means user-mode
  */
-fastcall void do_page_fault(struct pt_regs *regs, unsigned long error_code,
-                             unsigned long address)
+fastcall void do_page_fault(struct pt_regs *regs, unsigned long error_code)
 {
        struct task_struct *tsk;
        struct mm_struct *mm;
        struct vm_area_struct * vma;
+       unsigned long address;
        int write;
        siginfo_t info;
 
+       address = HYPERVISOR_shared_info->vcpu_data[
+               smp_processor_id()].arch.cr2;
+
        /* Set the "privileged fault" bit to something sane. */
        error_code &= ~4;
        error_code |= (regs->xcs & 2) << 1;
@@ -297,11 +300,10 @@ fastcall void do_page_fault(struct pt_regs *regs, unsigned long error_code,
        if (notify_die(DIE_PAGE_FAULT, "page fault", regs, error_code, 14,
                                        SIGSEGV) == NOTIFY_STOP)
                return;
-#if 0
+
        /* It's safe to allow irq's after cr2 has been saved */
-       if (regs->eflags & (X86_EFLAGS_IF|VM_MASK))
+       if ((uint8_t)(regs->xcs >> 16) == 0)
                local_irq_enable();
-#endif
 
        tsk = current;
 
index 66124e6114e95f8b5d200256aa5bdeaa238d4bd5..877a3027eea1bfff87d80beee825f0daed046740 100644 (file)
@@ -874,42 +874,8 @@ ENTRY(execve)
        ret
        CFI_ENDPROC
 
-
- /*
- * Copy error_entry because of the different stack frame
- */                        
 ENTRY(page_fault)
-        movq (%rsp),%rcx
-        movq 8(%rsp),%r11
-        addq $0x10,%rsp         # now %rsp points to %cr2
-        pushq %rax
-        leaq do_page_fault(%rip),%rax
-       cld     
-       subq  $13*8,%rsp
-       movq %rdx,12*8(%rsp)    # save %rdx
-       movq 13*8(%rsp),%rdx    # load rax
-       movq %rcx,11*8(%rsp)
-       movq %rdx,10*8(%rsp)    # store rax
-        movq %rsi,13*8(%rsp)    # now save %rsi
-        movq 14*8(%rsp),%rdx    # load %cr2, 3rd argument
-       movq %r8, 9*8(%rsp)
-       movq %r9, 8*8(%rsp)
-       movq %r10,7*8(%rsp)
-       movq %r11,6*8(%rsp)
-       movq %rbx,5*8(%rsp) 
-       movq %rbp,4*8(%rsp) 
-       movq %r12,3*8(%rsp) 
-       movq %r13,2*8(%rsp) 
-       movq %r14,1*8(%rsp) 
-       movq %r15,(%rsp)
-#if 0        
-       cmpl $__KERNEL_CS,CS(%rsp)
-       je  error_kernelspace
-#endif
-        /*
-         * 1st and 2nd arguments are set by error_call_handler
-         */
-        jmp error_call_handler
+       errorentry do_page_fault
 
 ENTRY(coprocessor_error)
        zeroentry do_coprocessor_error
@@ -948,24 +914,15 @@ ENTRY(nmi)
 paranoid_exit:
        testl %ebx,%ebx                         /* swapgs needed? */
        jnz paranoid_restore
+       testl $3,CS(%rsp)
+       jnz   paranoid_userspace
 paranoid_swapgs:       
-/*     swapgs */
+       swapgs
 paranoid_restore:      
        RESTORE_ALL 8
-/*     iretq */
+       iretq
 paranoid_userspace:    
        GET_THREAD_INFO(%rcx)
-#      movl threadinfo_flags(%rcx),%edx
-#      testl $_TIF_NEED_RESCHED,%edx
-#      jnz paranoid_resched
-#      testl $(_TIF_SIGPENDING|_TIF_NOTIFY_RESUME|_TIF_SINGLESTEP),%edx
-#      jnz paranoid_signal
-#      jmp paranoid_swapgs
-#paranoid_resched:             
-#/*    sti */
-#      call schedule
-#      jmp paranoid_exit
-#paranoid_signal:              
        movl threadinfo_flags(%rcx),%ebx
        andl $_TIF_WORK_MASK,%ebx
        jz paranoid_swapgs
@@ -975,13 +932,10 @@ paranoid_userspace:
        testl $_TIF_NEED_RESCHED,%ebx
        jnz paranoid_schedule
        movl %ebx,%edx                  /* arg3: thread flags */
-/*     sti */
-#      xorl %esi,%esi /* oldset */
-#      movq %rsp,%rdi /* &pt_regs */
+       sti
        xorl %esi,%esi                  /* arg2: oldset */
        movq %rsp,%rdi                  /* arg1: &pt_regs */
        call do_notify_resume
-#      jmp paranoid_exit
        cli
        jmp paranoid_userspace
 paranoid_schedule:
@@ -1057,4 +1011,3 @@ ENTRY(machine_check)
 ENTRY(call_debug)
        zeroentry do_call_debug
 
-
index fc4defe342f0625ff608bfe32f44ec718184eb61..80ea2d8cf56ac46d4dc54e33832df16792d05172 100644 (file)
@@ -89,7 +89,7 @@ int register_die_notifier(struct notifier_block *nb)
 
 static inline void conditional_sti(struct pt_regs *regs)
 {
-       if (regs->eflags & X86_EFLAGS_IF)
+       if ((uint8_t)(regs->cs >> 32) == 0)
                local_irq_enable();
 }
 
@@ -905,30 +905,33 @@ void do_call_debug(struct pt_regs *regs)
 }
 
 
+/*
+ * NB. All these are "interrupt gates" (i.e. events_mask is set) because we
+ * specify <dpl>|4 in the second field.
+ */
 static trap_info_t trap_table[] = {
-        {  0, 0, (__KERNEL_CS|0x3), (unsigned long)divide_error               },
-        {  1, 0, (__KERNEL_CS|0x3), (unsigned long)debug                      },
-        {  3, 3, (__KERNEL_CS|0x3), (unsigned long)int3                       },
-        {  4, 3, (__KERNEL_CS|0x3), (unsigned long)overflow                   },
-        {  5, 3, (__KERNEL_CS|0x3), (unsigned long)bounds                     },
-        {  6, 0, (__KERNEL_CS|0x3), (unsigned long)invalid_op                 },
-        {  7, 0, (__KERNEL_CS|0x3), (unsigned long)device_not_available       },
-        {  9, 0, (__KERNEL_CS|0x3), (unsigned long)coprocessor_segment_overrun},
-        { 10, 0, (__KERNEL_CS|0x3), (unsigned long)invalid_TSS                },
-        { 11, 0, (__KERNEL_CS|0x3), (unsigned long)segment_not_present        },
-        { 12, 0, (__KERNEL_CS|0x3), (unsigned long)stack_segment              },
-        { 13, 0, (__KERNEL_CS|0x3), (unsigned long)general_protection         },
-        { 14, 0, (__KERNEL_CS|0x3), (unsigned long)page_fault                 },
-        { 15, 0, (__KERNEL_CS|0x3), (unsigned long)spurious_interrupt_bug     },
-        { 16, 0, (__KERNEL_CS|0x3), (unsigned long)coprocessor_error          },
-        { 17, 0, (__KERNEL_CS|0x3), (unsigned long)alignment_check            },
+        {  0, 0|4, (__KERNEL_CS|0x3), (unsigned long)divide_error               },
+        {  1, 0|4, (__KERNEL_CS|0x3), (unsigned long)debug                      },
+        {  3, 3|4, (__KERNEL_CS|0x3), (unsigned long)int3                       },
+        {  4, 3|4, (__KERNEL_CS|0x3), (unsigned long)overflow                   },
+        {  5, 3|4, (__KERNEL_CS|0x3), (unsigned long)bounds                     },
+        {  6, 0|4, (__KERNEL_CS|0x3), (unsigned long)invalid_op                 },
+        {  7, 0|4, (__KERNEL_CS|0x3), (unsigned long)device_not_available       },
+        {  9, 0|4, (__KERNEL_CS|0x3), (unsigned long)coprocessor_segment_overrun},
+        { 10, 0|4, (__KERNEL_CS|0x3), (unsigned long)invalid_TSS                },
+        { 11, 0|4, (__KERNEL_CS|0x3), (unsigned long)segment_not_present        },
+        { 12, 0|4, (__KERNEL_CS|0x3), (unsigned long)stack_segment              },
+        { 13, 0|4, (__KERNEL_CS|0x3), (unsigned long)general_protection         },
+        { 14, 0|4, (__KERNEL_CS|0x3), (unsigned long)page_fault                 },
+        { 15, 0|4, (__KERNEL_CS|0x3), (unsigned long)spurious_interrupt_bug     },
+        { 16, 0|4, (__KERNEL_CS|0x3), (unsigned long)coprocessor_error          },
+        { 17, 0|4, (__KERNEL_CS|0x3), (unsigned long)alignment_check            },
 #ifdef CONFIG_X86_MCE
-        { 18, 0, (__KERNEL_CS|0x3), (unsigned long)machine_check              },
+        { 18, 0|4, (__KERNEL_CS|0x3), (unsigned long)machine_check              },
 #endif
-        { 19, 0, (__KERNEL_CS|0x3), (unsigned long)simd_coprocessor_error     },
-        { SYSCALL_VECTOR, 3, (__KERNEL_CS|0x3), (unsigned long)system_call   },
+        { 19, 0|4, (__KERNEL_CS|0x3), (unsigned long)simd_coprocessor_error     },
 #ifdef CONFIG_IA32_EMULATION
-       { IA32_SYSCALL_VECTOR, 3, (__KERNEL_CS|0x3), (unsigned long)ia32_syscall},
+       { IA32_SYSCALL_VECTOR, 3|4, (__KERNEL_CS|0x3), (unsigned long)ia32_syscall},
 #endif
         {  0, 0,           0, 0                                              }
 };
index 5a1d57219e4129362577e31a809dd3e5cdba129f..bba3950aedab7db361f5d6ae9eaaafb4c0a759c3 100644 (file)
@@ -5,7 +5,7 @@
 #define evtchn_upcall_pending          0
 #define evtchn_upcall_mask             1
 
-#define sizeof_vcpu_shift              4
+#define sizeof_vcpu_shift              5
 
 #ifdef CONFIG_SMP
 //#define preempt_disable(reg) incl threadinfo_preempt_count(reg)
index d7ef1409cdceefd4b0ec00e501e58b3f4a4ae802..54e1eeadcc912a88e3cff11d73b023ab9c26d96e 100644 (file)
@@ -318,12 +318,12 @@ int exception_trace = 1;
  *     bit 2 == 0 means kernel, 1 means user-mode
  *      bit 3 == 1 means fault was an instruction fetch
  */
-asmlinkage void do_page_fault(struct pt_regs *regs, unsigned long error_code,
-       unsigned long address)
+asmlinkage void do_page_fault(struct pt_regs *regs, unsigned long error_code)
 {
        struct task_struct *tsk;
        struct mm_struct *mm;
        struct vm_area_struct * vma;
+       unsigned long address;
        const struct exception_table_entry *fixup;
        int write;
        siginfo_t info;
@@ -342,11 +342,16 @@ asmlinkage void do_page_fault(struct pt_regs *regs, unsigned long error_code,
                }
        }
 #endif
+
+       /* get the address */
+       address = HYPERVISOR_shared_info->vcpu_data[
+               smp_processor_id()].arch.cr2;
+
        if (notify_die(DIE_PAGE_FAULT, "page fault", regs, error_code, 14,
                                        SIGSEGV) == NOTIFY_STOP)
                return;
 
-       if (likely(regs->eflags & X86_EFLAGS_IF))
+       if (likely((uint8_t)(regs->cs >> 32) == 0))
                local_irq_enable();
 
        if (unlikely(page_fault_trace))
index 58d51c9eb8338dd1dcd83f65205ee94e7e4cddbe..01ed11af3f05d94f37ecee356aaf9d4e00b0d2b6 100644 (file)
@@ -430,6 +430,10 @@ void __init __start_xen(multiboot_info_t *mbi)
     /* Sanity check for unwanted bloat of dom0_op_t structure. */
     BUG_ON(sizeof(((dom0_op_t *)0)->u) != sizeof(((dom0_op_t *)0)->u.pad));
 
+    BUG_ON(sizeof(start_info_t) > PAGE_SIZE);
+    BUG_ON(sizeof(shared_info_t) > PAGE_SIZE);
+    BUG_ON(sizeof(vcpu_info_t) != (sizeof(unsigned long) * 4));
+
     init_frametable();
 
     end_boot_allocator();
index df278750fdc6be39e14044024a481dace0447f07..126966fd7c2cb87de3db2fd978a9b16766790b20 100644 (file)
@@ -412,16 +412,16 @@ void propagate_page_fault(unsigned long addr, u16 error_code)
     struct vcpu *v = current;
     struct trap_bounce *tb = &v->arch.trap_bounce;
 
+    v->arch.guest_context.ctrlreg[2] = addr;
+    v->vcpu_info->arch.cr2           = addr;
+
     ti = &v->arch.guest_context.trap_ctxt[TRAP_page_fault];
-    tb->flags = TBF_EXCEPTION | TBF_EXCEPTION_ERRCODE | TBF_EXCEPTION_CR2;
-    tb->cr2        = addr;
+    tb->flags = TBF_EXCEPTION | TBF_EXCEPTION_ERRCODE;
     tb->error_code = error_code;
     tb->cs         = ti->cs;
     tb->eip        = ti->address;
     if ( TI_GET_IF(ti) )
         tb->flags |= TBF_INTERRUPT;
-
-    v->arch.guest_context.ctrlreg[2] = addr;
 }
 
 static int handle_perdomain_mapping_fault(
@@ -931,6 +931,7 @@ static int emulate_privileged_op(struct cpu_user_regs *regs)
 
         case 2: /* Write CR2 */
             v->arch.guest_context.ctrlreg[2] = *reg;
+            v->vcpu_info->arch.cr2           = *reg;
             break;
             
         case 3: /* Write CR3 */
index 22b911fd0449eea17eb22dcd60b5dfbca50e02df..3a5c3ef9f87bd0ac64550b0731a51f10c8798b0f 100644 (file)
@@ -75,7 +75,6 @@ void __dummy__(void)
     BLANK();
 
     OFFSET(TRAPBOUNCE_error_code, struct trap_bounce, error_code);
-    OFFSET(TRAPBOUNCE_cr2, struct trap_bounce, cr2);
     OFFSET(TRAPBOUNCE_flags, struct trap_bounce, flags);
     OFFSET(TRAPBOUNCE_cs, struct trap_bounce, cs);
     OFFSET(TRAPBOUNCE_eip, struct trap_bounce, eip);
index 12878630f3425c93e2ef320ecb8b1a206de3e62e..5712895a65a07630062089f7dcadc7afeed35151 100644 (file)
@@ -401,30 +401,25 @@ FLT16:  movl %eax,%gs:8(%esi)
         subl $4,%esi                    # push error_code onto guest frame
         movl TRAPBOUNCE_error_code(%edx),%eax
 FLT17:  movl %eax,%gs:(%esi)
-        testb $TBF_EXCEPTION_CR2,%cl
-        jz   2f
-        subl $4,%esi                    # push %cr2 onto guest frame
-        movl TRAPBOUNCE_cr2(%edx),%eax
-FLT18:  movl %eax,%gs:(%esi)
 1:      testb $TBF_FAILSAFE,%cl
         jz   2f
         subl $16,%esi                # add DS/ES/FS/GS to failsafe stack frame
         testl $X86_EFLAGS_VM,UREGS_eflags+4(%esp)
         jz   nvm86_2
         xorl %eax,%eax               # VM86: we write zero selector values
-FLT19:  movl %eax,%gs:(%esi) 
-FLT20:  movl %eax,%gs:4(%esi)
-FLT21:  movl %eax,%gs:8(%esi) 
-FLT22:  movl %eax,%gs:12(%esi)
+FLT18:  movl %eax,%gs:(%esi) 
+FLT19:  movl %eax,%gs:4(%esi)
+FLT20:  movl %eax,%gs:8(%esi) 
+FLT21:  movl %eax,%gs:12(%esi)
         jmp  2f
 nvm86_2:movl UREGS_ds+4(%esp),%eax   # non-VM86: write real selector values
-FLT23:  movl %eax,%gs:(%esi) 
+FLT22:  movl %eax,%gs:(%esi) 
         movl UREGS_es+4(%esp),%eax
-FLT24:  movl %eax,%gs:4(%esi)
+FLT23:  movl %eax,%gs:4(%esi)
         movl UREGS_fs+4(%esp),%eax
-FLT25:  movl %eax,%gs:8(%esi) 
+FLT24:  movl %eax,%gs:8(%esi) 
         movl UREGS_gs+4(%esp),%eax
-FLT26:  movl %eax,%gs:12(%esi)
+FLT25:  movl %eax,%gs:12(%esi)
 2:      testl $X86_EFLAGS_VM,UREGS_eflags+4(%esp)
         jz   nvm86_3
         xorl %eax,%eax      /* zero DS-GS, just as a real CPU would */
@@ -456,7 +451,6 @@ nvm86_3:/* Rewrite our stack frame and return to ring 1. */
         .long FLT20,domain_crash_synchronous , FLT21,domain_crash_synchronous
         .long FLT22,domain_crash_synchronous , FLT23,domain_crash_synchronous
         .long FLT24,domain_crash_synchronous , FLT25,domain_crash_synchronous
-        .long FLT26,domain_crash_synchronous
 .previous
 
         ALIGN
index 742212154a72e6cb35fa5f21a70367b2fd3b2930..c7a3e6025c00f50f79ceb681a365b773a7d645ae 100644 (file)
@@ -75,7 +75,6 @@ void __dummy__(void)
     BLANK();
 
     OFFSET(TRAPBOUNCE_error_code, struct trap_bounce, error_code);
-    OFFSET(TRAPBOUNCE_cr2, struct trap_bounce, cr2);
     OFFSET(TRAPBOUNCE_flags, struct trap_bounce, flags);
     OFFSET(TRAPBOUNCE_cs, struct trap_bounce, cs);
     OFFSET(TRAPBOUNCE_eip, struct trap_bounce, eip);
index 10be586c78a7d60889be533968d1fe41802ef90d..90e485570bfe4d8e70d154eb6809abd83c54fdbc 100644 (file)
@@ -370,27 +370,22 @@ FLT6:   movq  %rax,(%rsi)               # RIP
         subq  $8,%rsi
         movl  TRAPBOUNCE_error_code(%rdx),%eax
 FLT7:   movq  %rax,(%rsi)               # ERROR CODE
-        testb $TBF_EXCEPTION_CR2,%cl
-        jz    2f
-        subq  $8,%rsi
-        movq  TRAPBOUNCE_cr2(%rdx),%rax
-FLT8:   movq  %rax,(%rsi)               # CR2
 1:      testb $TBF_FAILSAFE,%cl
         jz    2f
         subq  $32,%rsi
         movl  %gs,%eax
-FLT9:   movq  %rax,24(%rsi)             # GS
+FLT8:   movq  %rax,24(%rsi)             # GS
         movl  %fs,%eax
-FLT10:  movq  %rax,16(%rsi)             # FS
+FLT9:   movq  %rax,16(%rsi)             # FS
         movl  %es,%eax
-FLT11:  movq  %rax,8(%rsi)              # ES
+FLT10:  movq  %rax,8(%rsi)              # ES
         movl  %ds,%eax
-FLT12:  movq  %rax,(%rsi)               # DS
+FLT11:  movq  %rax,(%rsi)               # DS
 2:      subq  $16,%rsi
         movq  UREGS_r11+8(%rsp),%rax
-FLT13:  movq  %rax,8(%rsi)              # R11
+FLT12:  movq  %rax,8(%rsi)              # R11
         movq  UREGS_rcx+8(%rsp),%rax
-FLT14:  movq  %rax,(%rsi)               # RCX
+FLT13:  movq  %rax,(%rsi)               # RCX
         /* Rewrite our stack frame and return to guest-OS mode. */
         /* IA32 Ref. Vol. 3: TF, VM, RF and NT flags are cleared on trap. */
         movl  $TRAP_syscall,UREGS_entry_vector+8(%rsp)
@@ -411,7 +406,6 @@ FLT14:  movq  %rax,(%rsi)               # RCX
         .quad  FLT8,domain_crash_synchronous ,  FLT9,domain_crash_synchronous
         .quad FLT10,domain_crash_synchronous , FLT11,domain_crash_synchronous
         .quad FLT12,domain_crash_synchronous , FLT13,domain_crash_synchronous
-        .quad FLT14,domain_crash_synchronous
 .previous
 
         ALIGN
index 36aa222bd2c9e96870aca754baff450db689f3ae..ed05d32c819eb9e9517cde3c4a181a0e67bcf2b3 100644 (file)
@@ -8,7 +8,6 @@
 
 struct trap_bounce {
     unsigned long  error_code;
-    unsigned long  cr2;
     unsigned short flags; /* TBF_ */
     unsigned short cs;
     unsigned long  eip;
index b312175e8c3b6c9922941bc9c73851b354a8db48..5e0d60d5bef2adc22a1dbeb93e8312ce8e63950d 100644 (file)
 /* 'trap_bounce' flags values */
 #define TBF_EXCEPTION          1
 #define TBF_EXCEPTION_ERRCODE  2
-#define TBF_EXCEPTION_CR2      4
 #define TBF_INTERRUPT          8
 #define TBF_FAILSAFE          16
 
index 01ce7d02d0000e1cbe069f82673860122280b59f..bb7cd216bb8f9eab69cc1cf938802be9982a669a 100644 (file)
@@ -271,12 +271,10 @@ typedef struct {
 
 typedef mapped_regs_t vpd_t;
 
-#define __ARCH_HAS_VCPU_INFO
-
 typedef struct {
     unsigned int flags;
     unsigned long start_info_pfn;
-} arch_shared_info_t;  // DON'T PACK 
+} arch_shared_info_t;
 
 typedef struct vcpu_guest_context {
 #define VGCF_FPU_VALID (1<<0)
index 4b13ccc94c8d13bf54d70c5bf03b4e5214b75cd5..7b09dc67a9fd13fc8c9ba4c85c2fcb902fdc63b1 100644 (file)
@@ -132,6 +132,11 @@ typedef struct arch_shared_info {
     unsigned long pfn_to_mfn_frame_list_list; 
 } arch_shared_info_t;
 
+typedef struct {
+    unsigned long cr2;
+    unsigned long pad; /* sizeof(vcpu_info_t) == 16 */
+} arch_vcpu_info_t;
+
 #endif
 
 #endif
index 366be67fcae9cf3e204a6c1c01797d01e8f82c7c..a0ec55ede18abea39801f88d3e91a6a9b36755f4 100644 (file)
@@ -201,6 +201,11 @@ typedef struct arch_shared_info {
     unsigned long pfn_to_mfn_frame_list_list; 
 } arch_shared_info_t;
 
+typedef struct {
+    unsigned long cr2;
+    unsigned long pad; /* sizeof(vcpu_info_t) == 32 */
+} arch_vcpu_info_t;
+
 #endif /* !__ASSEMBLY__ */
 
 #endif
index a6447c30f9474f6877f0f686d21f2c1c686a2277..ae5a4e74a016cc30e0967201912125cc5102257b 100644 (file)
@@ -19,7 +19,7 @@
  * This makes sure that old versions of dom0 tools will stop working in a
  * well-defined way (rather than crashing the machine, for instance).
  */
-#define DOM0_INTERFACE_VERSION   0xAAAA1011
+#define DOM0_INTERFACE_VERSION   0xAAAA1012
 
 /************************************************************************/
 
index 3aba9e68ef4eaa9e4bfbdc9915d249c33ecf797a..51697ef15acc41b72f503e3afc92900ff4137a0f 100644 (file)
@@ -299,9 +299,7 @@ typedef struct vcpu_info {
     uint8_t evtchn_upcall_pending;
     uint8_t evtchn_upcall_mask;
     unsigned long evtchn_pending_sel;
-#ifdef __ARCH_HAS_VCPU_INFO
     arch_vcpu_info_t arch;
-#endif
 } vcpu_info_t;
 
 typedef struct vcpu_time_info {